<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page language="java" import="com.jxLC.Action.*"%>
<%@ page language="java" import="com.jxLC.Model.*" %>
<%@ page language="java" import="com.jxLC.Service.*" %>
<%@ page language="java" import="java.io.File" %>
<%@page import="java.text.SimpleDateFormat"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>:::江西低碳合作交流网:::</title>
	<link href="/mycss/my.css"  rel="stylesheet" type="text/css" />
	<style type="text/css">
	.createdate{
		font-size: 12px;
		float:right;
		height:25px; 
	    line-height:25px; 
	    overflow:hidden; 
	}
	.topic {
		float: left;
		font-size: 14px;
	}
	</style>
	<script type="text/javascript" src="/myjs/jquery.js"></script>
	<script type="text/javascript" src="/myjs/link.js"></script>
    <script type="text/javascript" src="/myjs/my.js"></script>
    <script type="text/javascript" src="/myjs/lunbo.js"></script>
    <script type="text/javascript">
  

       var result ="<%=request.getAttribute("errorMessage")%>";
        var result2 ="<%=request.getAttribute("addsuccess")%>";                                     
     
     if(result2!='null'  &&  result2!=undefined)
     {
           alert(result2);
     }   
     
   		function checkForm(myform) {				
				if(myform.Cnum.value == "") {
					alert('用户账号必须输入！');
					myform.Cnum.focus();
					return false;
				}
				if(myform.CPasswd.value == "") {
					alert('密码必须输入！');
					myform.CPasswd.focus();
					return false;
				}
				return true;	
			}
	</script>	
  </head>
  
 <body  style="background-color:#EBFCF3" >
 
  <div id="all">
    <s:include value="/admin/header.jsp"></s:include>
	</div>
	
	<div id="middle">
	    <div id="mL">
		    <div id="mL1">
			    <div id="mL1a">
			       <div class="scrollframe">
                   <div class="scrollcontent" id="content"> 
                     <!--显示上传的图片  -->
                    <%
                    String dir=pageContext.getServletContext().getRealPath("/my.photo/photo/imageUpload");
                    File imageUpload = new File(dir);
                    File [] images=imageUpload.listFiles(); 
                    String image=null;      
                    for(int i=0;i<images.length;i++){
                        for(int j=0;j<images.length;j++){
                           String imageName=images[j].getName();
                           int n=imageName.indexOf(".");
                           String index=imageName.substring(0,n);
                           if(Integer.valueOf(index)==i){
                             image=imageName;
                           } 
                        }
                        String imagePath="/my.photo/photo/imageUpload"+"/"+image;
                    %>
                      <img style="width:264px ;height:315px " src="<%=imagePath%>"/> 
                  <%  }  %>
                   <!--显示上传的图片  --> 


			       </div>
                   <ul id="lunbo">
                        <Li >1</li>
                        <Li >2</li>
                        <Li >3</li>
                   </ul>
                   
                   </div>
 			    </div>
				<div id="mL1b">
				    <div id="mL1b1"><span style="float:left;"><img src="/my.photo/photo/logo/icons/arrow_branch.png" />新 闻</span>   
				    	<span style="float:right;"><a  href="/Detail/news.jsp" target="_balnk">更多...</a></span> 
				    </div>
					 <div id="mL1b2">
					 <ul id="u1">
					 <%
					 Map<Integer, List<Content>> contentmap=(Map<Integer, List<Content>>)request.getAttribute("contentmap");
					 List<Content> contents = contentmap.get(1);
		              for(Content content : contents){
			                %>
			                  <li>
			                  <div class="topic" style="float:left;">
			                  	<img src="my.photo/photo/logo5.jpg">&nbsp;<a href="getContenttextAction.action?CContent_ID=<%=content.getCContent_ID() %>&source=index" target="_blank"><%=content.getCContent_topic()%></a>
			                  <% 
			                  if("Y".equals(content.getCnewtarget())){ %><img alt="" src="/my.photo/photo/new.gif">  <% } %>
			                  </div>
			                  <div class="createdate" style="float:right;"><%=content.getCContent_time() %></div>
			                  </li>
			                <%
		                  }
					  %>
					 </ul>
					</div>
				</div>
			</div>
			<div id="mL2">
			    <div id="mL2a">
				    <div id="mL2a1"><span style="float:left;"><img src="my.photo/photo/logo/icons/world_go.png" />  展会动态</span>
				    	<span style="float:right;"><a href="Detail/exhibition.jsp" target="_balnk">更多...</a></span>
				    </div>
					<div id="mL2a2">
					    <ul id="u1">
					    <%
					    	contents=contentmap.get(2);
					    	for(Content content:contents){
					    		%>
					     <li><img src="my.photo/photo/logo6.jpg">&nbsp;<a href="getContenttextAction.action?CContent_ID=<%=content.getCContent_ID() %>" target="_blank"><%=content.getCContent_topic() %></a></li>
					    		<%
					    	}
					     %>
					    </ul>
					</div>
				</div>
				<div id="mL2b">
				    <div id="mL2b1"><span style="float:left;"><img src="my.photo/photo/logo/icons/arrow_divide.png" />  前沿技术</span>
				     	<span style="float:right;"><a href="Detail/technology.jsp" target="_balnk">更多...</a></span>
				     </div>
					<div id="mL2b2">
					    <ul id="u1">
					    <%
					    	contents=contentmap.get(3);
					    	for(Content content:contents){
					    		
					    		%>
					     <li><img src="my.photo/photo/logo6.jpg">&nbsp;<a href="getContenttextAction.action?CContent_ID=<%=content.getCContent_ID() %>" target="_blank"><%=content.getCContent_topic() %></a></li>
					    		<%
					    	}
					     %>
					    </ul>
					</div>
				</div>
			</div>
            <div id="mL3">
			    <div id="mL3a">
				    <div id="mL3a1"><span style="float:left;"><img src="my.photo/photo/logo/icons/brick_go.png" />  江西低碳 </span>
				    <span style="float:right;"><a href="Detail/jxtc.jsp" target="_balnk">更多...</a></span>
				    </div>
					<div id="mL3a2">
					    <ul id="u1">
					    <%
					    	contents=contentmap.get(4);
					    	for(Content content:contents){
					    		
					    		%>
					     <li><img src="my.photo/photo/logo6.jpg">&nbsp;<a href="getContenttextAction.action?CContent_ID=<%=content.getCContent_ID() %>" target="_blank"><%=content.getCContent_topic() %></a></li>
					    		<%
					    	}
					     %>
					     </ul>  
					</div>
				</div>
				<div id="mL3b">
				    <div id="mL3b1"><span style="float:left;"><img src="my.photo/photo/logo/icons/arrow_inout.png" />  科普知识 </span>
				    <span style="float:right;"><a href="Detail/science.jsp" target="_balnk">更多...</a></span>
				    </div>
					<div id="mL3b2">
					    <ul id="u1">
					    <%
					    	contents=contentmap.get(5);
					    	for(Content content:contents){
					    		
					    		%>
					     <li><img src="my.photo/photo/logo6.jpg">&nbsp;<a href="getContenttextAction.action?CContent_ID=<%=content.getCContent_ID() %>" target="_blank"><%=content.getCContent_topic() %></a></li>
					    		<%
					    	}
					     %>
					    </ul>   
					</div>
				</div>
			</div>
			<div id="mL4">
			    <div id="mL4a">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" class="a1">战略合作伙伴</a> | <a href="#" class="a2">友情链接</a></div>
				<div id="mL4b">
				<s:iterator var="link1" value="lk1">
				               <a href="${link1.link }" target="_blank">${link1.lname }</a>
				</s:iterator>
				</div>
				<div id="mL4c" style="display: none">
					<s:iterator var="link2" value="lk2">
					               <a href="${link2.link }" target="_blank">${link2.lname }</a>
					</s:iterator>
				</div>
			</div>
		</div>
		<div id="mM"></div>
		<div id="mR">
		    <div id="mR1">
			    <div id="mR1a">
			       <form action="Detail/searchresult.jsp"  >
			             <img  src="my.photo/photo/logo/icons/zoom_in.png" />  
			             全站搜索:&nbsp;<input size="15" type="text" name="title" value="关键词" onmouseover="this.focus()" onfocus="this.select()" style="border: 1px solid green;height:24px;width:10px； padding-top:4px;"/> 
				         <input type="submit" style="height:28px;width:50px;" value="检索" /> 
				   </form>
				</div>
				<div id="mR1b">&nbsp;&nbsp;<img src="my.photo/photo/logo/icons/user_add.png" />  项目信息平台</div>
				<% 
				User user=(User)session.getAttribute("us"); 
				if(user == null){
				%>
				<div id="mR1c">
				    <div id="mf">
				   <form action="Login!login" method="post" onsubmit="return checkForm(this);">
				       <br>
				                          用户名：<input type="text" name="Cnum" style="border: 1px solid #00FF99 ;padding-top:3px; height:25px;width:140px; " /><br><br>
					     密&nbsp; 码：<input type="password" name="CPasswd" style="border: 1px solid #00FF99;padding-top:3px;width:140px; height:25px;" /><br><br>
					     <input type="submit" value="登 录" style="width:80px;height:30px;font-size:16px;font-family:'新宋体'; font-weight:bold;"  />&nbsp;&nbsp;
					     <input type="button" value="注册" style="width:80px;height:30px;font-size:16px;font-family:'新宋体'; font-weight:bold;" onclick="Do()" />
					<script type="text/javascript">
					function Do(){
					window.open("/zhuce.jsp ");
					}
					</script>
				   </form>
				    </div>
				</div>
				<%
				}else {
				%>
				<div id="mR1c">
				    <div id="mff">
				        <div id="mff1">欢迎您！<font color="blue" size="4px"><%=user.getCnum()%></font> 您已成功登录！</div>
				        <div id="mff2"><a href="contentAction?action=logout">[点此退出个人登录]</a></div>
				        <div id="mff3"><a href="user/check.jsp?Cnum=<%=user.getCnum() %>" target="_blank">进入用户主页</a></div>
				    </div>
				</div>
				<%
				}
				%>
			</div> 
			<div id="mR2">
			    <div id="mR2a"><span style="float:left;"><img src="my.photo/photo/logo/icons/application_view_columns.png" />  项目信息  </span>
			    	<span style="float:right;"><a href="Detail/iinfo.jsp" target="_balnk">更多...</a></span>
			    </div>
				<div id="mR2b">
				     <ul id="u1">
				     <%
					 Map<Integer, List<Filecontent>> fcontentmap=(Map<Integer, List<Filecontent>>)request.getAttribute("fcontentmap");
					 List<Filecontent> fcontents = fcontentmap.get(1);
		              for(Filecontent fcontent : fcontents){
			                %>
			                  <li>
			                  <img src="my.photo/photo/logo6.jpg">&nbsp;<a href="getFContenttextAction.action?CFC_id=<%=fcontent.getCFC_id() %>" target="_blank"><%=fcontent.getCFC_topic()%></a>
			                  </li>
			                <%
		                  }
					  %>
					     </ul>   
				</div>
			</div>

			<div id="mR3"></div>
		</div>
		<div id="mT"></div>
	</div>  
	
	<s:include value="/admin/tail.jsp"></s:include>
</body>
</html>

